//
//  receiver.hpp
//  Wi-Fi Party remade-1
//
//  Created by Vieta Ken on 2021/6/4.
//

#ifndef receiver_hpp
#define receiver_hpp


#include <stdio.h>
#include <map>
#include <list>
#include <pthread.h>
#include "channel.hpp"

#include "packet.hpp"




class Receiver{
public:
    std::map<int,std::map<unsigned int, bool>*> *known_hosts;
    std::list<Channel*> *channels;
    int socket;

    Receiver(int socket);
    ~Receiver();
    void addChannel(Channel *channel);
    void receive_forever();
    void receive_blocking();//Blocks the thread
};

struct _arguments_for_process_a_packet{
    Receiver *receiver;
    Packet *received_packet;
};

#endif /* receiver_hpp */
